# -*- coding: utf-8 -*-,
# @File : 8.试客联盟.py,
# @Author : lidong,
# @IDEA: PyCharm
# @Time :  2022/5/13 16:25
import requests
import execjs
import re

# 获取rsa_n
rsa_n = requests.get('http://login.shikee.com/getkey?v=4d7ba8ea09dc4902ce2c86012f762dfd').text
s = 'var rsa_n = "(.*?)";'
rsa_n = re.findall(s, rsa_n)[0]
print(rsa_n)
node = execjs.get()
ctx = node.compile(open('./shike.js', encoding='utf-8').read())
funcName = "getpwd('{0}','{1}')".format("Aa13887746928", rsa_n)

password = ctx.eval(funcName)

data = {
    'username': 'lidongzm',
    'password': password,
    'vcode': '',
    'to': 'http://www.shikee.com/'
}
headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36'
}

login_page = requests.post(url='http://login.shikee.com/check/?&_1652431583207', data=data, headers=headers)
print(login_page.json())